System and method for defect detection in a print system

ABSTRACT

A system for detecting defects in a print system may include a print engine to print an electronic document (a reference image) and yield a printed document. The system may also include an image sensor to scan the printed document into a scanned electronic document (a target image). The system may include a processing device to detect defects in the printed document by analyzing the activity level in the reference and target image. The system may identify a quiet area/pixel in the reference image based on the activity level, check the activity level of the corresponding pixel in the target image, and classify the pixel in the target image as defective if the activity level of the pixel in the target image exceeds a noise threshold. The system may additionally swap the reference and target image, repeat the detection steps and combine the detection results with those before the swap.

RELATED APPLICATIONS

This patent document claims priority to U.S. Provisional PatentApplication No. 62/455,731 filed Feb. 7, 2017, the disclosure of whichis incorporated herein by reference in full.

BACKGROUND

This disclosure relates to print and image systems and in particular todetecting defects in images and printed documents.

In a print system there are common defects that may occur in printeddocuments. These defects include, for example, image streaking, imagebanding, excessive graininess, small area deletions and large areadeletions. Some existing systems for detecting the defects compare theimage of the original electronic document to be printed (referenceimage) with the image of the printed document (target image) todetermine if any differences exist. Some comparison methods are eitherbased on global comparison models, such as SIFT, histogram comparisonsand feature vectors, or based on pixel by pixel local differences, suchas Structural Similarity Index (SSIM). However, none of these methodscan effectively detect the defects in printed documents where thedifferences between the reference image and the target image are small,colors vary between the reference image and target image, or imagealignment between the two is not perfect. For example, some existingmethods that compare gray levels between the reference and target imagesdo not perform well given the difficulty of accurately matching thecolors. There are also similar issues in detecting defects in an imagesystem, such as detecting defects in a printed or processed image.

This document describes systems and methods that are intended to addressat least some issues discussed above and/or other issues.

SUMMARY

In some embodiments, a system for detecting defects in a print systemmay include a print engine configured to print a first electronicdocument to yield a printed document. The system may also include animage sensor configured to scan the printed document into a secondelectronic document. The system may include a processing device. Thesystem may also include a non-transitory, computer-readable mediumcontaining programming instructions that are configured to cause theprocessing device to detect defects in the printed document. In someembodiments, the system may obtain a reference image comprising contentof a page of the first electronic document, and obtain a target imagecomprising content of a page of the second electronic document.

The system may analyze the reference image to determine a first activitymatrix comprising activity levels for a plurality of pixels of thereference image, and analyze the target image to determine a secondactivity matrix comprising activity levels for a plurality of pixels inthe target image. The system may use the first activity matrix toclassify one or more pixels in the reference image as corresponding to aquiet area, which denotes an area in which a pixel and its neighboringpixels exhibit less than a threshold level of activity. For at least asubset of the pixels in the reference image that correspond to the quietarea, the system may compare each pixel in the subset to a correspondingpixel in the target image to determine whether a difference between theactivity level of each pixel in the subset and the activity level of thecorresponding pixel in the target image exceeds a noise threshold. Forany reference image pixel and corresponding target image pixel, forwhich the difference of activity level exceeds the noise threshold, thesystem may classify that target image pixel as defective. The system mayfurther determine a defect detection map that comprises each of thetarget pixels that were classified as defective.

In determining the first activity matrix, the system may calculate astandard deviation for each of the pixels in the reference image using afirst low-pass filter Similarly, in determining the second activitymatrix, the system may calculate a standard deviation for each of thepixels in the target image using a second low-pass filter. In someembodiments, the first low-pass and the second low-pass filters are atwo-dimensional window comprising a plurality of coefficients havingequal values.

In some embodiments, in classifying the one or more pixels in thereference image as corresponding to a quiet area, the system maydetermine that the activity levels of the one or more pixels in thereference image are below a first threshold. In determining that thedifference of activity level exceeds the noise threshold, the system maydetermine that the activity level of each corresponding pixel in thetarget image is above a first threshold, and that a ratio of theactivity level of each corresponding pixel in the target image over theactivity level of each pixel of the subset in the reference image isabove a second threshold.

In some embodiments, the system may perform a morphological dilation onthe first activity matrix to update the first activity matrix, and/orperform a morphological erosion on the second activity matrix to updatethe second activity matrix, before classifying the pixels in thereference image and the target image. The morphological dilation can bea gray-scale dilation and the morphological erosion can also agray-scale erosion. The system may also connect one or more defectivepixels in the defect detection map into one or more connectedcomponents. In connecting the one or more defective pixels in the defectdetection map, the system may perform a morphological closing on thedefect detection map. Alternatively, and/or additionally, the system mayfurther include a morphological opening on the defect detection map. Thesystem may also identify from the one or more connected components inthe defect detection map a largest connected component. The system mayalso determine a confidence level to defect detection based on the sizeof the largest connected component.

In some embodiments, the system may perform the same detection steps asdisclosed above and repeat these steps with the reference and targetimage swapped. In each round performing the above steps, before andafter the swapping, the system generates a defect detection map thatincludes target image pixels that were classified as defective. Thesystem may combine the defect detection map from each round of detectionso that all of the target image pixels that were classified as defectivein either round may be classified as defective in the combined defectdetection map. Similar to above illustrated embodiments in defectdetection, the system may also connect one or more defective pixels inthe combined defect detection map into one or more connected components.In connecting the one or more defective pixels in the defect detectionmap, the system may perform a morphological closing on the defectdetection map. Alternatively, and/or additionally, the system mayfurther include a morphological opening on the defect detection map. Thesystem may also identify from the one or more connected components inthe combined defect detection map a largest connected component. Thesystem may also determine a confidence level to defect detection basedon the size of the largest connected component.

Alternatively, and/or additionally, the system may determine ahorizontal and vertical activity matrix separately in a similar manneras described above and combine the results. In some embodiments, thesystem may analyze the reference image to determine a first horizontalactivity matrix comprising horizontal activity levels for a plurality ofpixels of the reference image, and analyze the target image to determinea second horizontal activity matrix comprising horizontal activitylevels for a plurality of pixels in the target image. The system mayalso use the first horizontal activity matrix to classify a first set ofpixels comprising one or more pixels in the reference image ascorresponding to a quiet area, which denotes an area in which a pixeland its neighboring pixels exhibit less than a threshold level ofactivity. For at least a subset of the first set of pixels in thereference image that correspond to the quiet area, the system maycompare each pixel in the subset of the first set of pixels to acorresponding pixel in the target image to determine whether thedifference between the horizontal activity level of each pixel in thesubset and the horizontal activity level of the corresponding pixel inthe target image exceeds a noise threshold. For any reference imagepixel and corresponding target image pixel, for which the difference ofhorizontal activity level exceeds the noise threshold, the system mayclassify that target image pixel as defective.

Alternatively, and/or additionally, the system may analyze the referenceimage to determine a first vertical activity matrix comprising verticalactivity levels for a plurality of pixels of the reference image, andanalyze the target image to determine a second vertical activity matrixcomprising vertical activity levels for a plurality of pixels in thetarget image. The system may also use the first vertical activity matrixto classify a second set of pixels comprising one or more pixels in thereference image that, based on their activity levels, as correspondingto a variation area. For at least a subset of the second set of pixelsin the reference image that correspond to the variation area, the systemmay compare each pixel in the subset of the second set of pixels to acorresponding pixel in the target image to determine whether thedifference between the vertical activity level of each pixel in thesubset and the vertical activity level of the corresponding pixel in thetarget image exceeds a noise threshold. For any reference image pixeland corresponding target image pixel, for which the difference ofvertical activity level exceeds the noise threshold, the system mayclassify that target image pixel as defective. In some embodiments, thesystem may determine a combined defect detection map that comprises allof the target image pixels that were classified as defective based onthe horizontal activity matrix and the vertical activity matrix.

Various features in detecting defects based on a single activity matrixdescribed above also apply to detecting defects based on horizontalactivity matrix combined with vertical activity matrix. Additionally, insome embodiments, the system may perform the same detection steps asdisclosed above that are based on the horizontal activity matrix and thevertical activity matrix, and repeat these steps with the reference andtarget image swapped. In each round performing the above steps, beforeand after the swapping, the system may generate a defect detection mapthat includes target image pixels that were classified as defective. Thesystem may combine the defect detection map from each round of detectionso that all of the target image pixels that were classified as defectivein either round may be classified as defective in the combined defectdetection map.

Similar to above illustrated embodiments in defect detection, for thecombined defect detection map that was obtained based on the defectdetection map determined before and after the swap of the reference andtarget image, the system may also connect one or more defective pixelsin the combined defect detection map into one or more connectedcomponents. In connecting the one or more defective pixels in the defectdetection map, the system may perform a morphological closing on thedefect detection map. Alternatively, and/or additionally, the system mayfurther include a morphological opening on the defect detection map. Thesystem may also identify from the one or more connected components inthe combined defect detection map a largest connected component. Thesystem may also determine a confidence level to defect detection basedon the size of the largest connected component.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 depicts a print system according to some embodiments.

FIG. 2 depicts a diagram of a process of detecting defects in a printsystem according to various embodiments.

FIG. 3 depicts a diagram of a process of detecting defects in a printsystem based on horizontal and vertical activities according to variousembodiments.

FIGS. 4A-4B depict a diagram of a process of detecting defects in aprint system by swapping the reference image and the target imageaccording to various embodiments.

FIG. 5 depicts various embodiments of one or more electronic devices forimplementing the various methods and processes described herein.

DETAILED DESCRIPTION

This disclosure is not limited to the particular systems, methodologiesor protocols described, as these may vary. The terminology used in thisdescription is for the purpose of describing the particular versions orembodiments only, and is not intended to limit the scope.

As used in this document, any word in singular form, along with thesingular forms “a,” “an” and “the,” include the plural reference unlessthe context clearly dictates otherwise. Unless defined otherwise, alltechnical and scientific terms used herein have the same meanings ascommonly understood by one of ordinary skill in the art. Allpublications mentioned in this document are incorporated by reference.Nothing in this document is to be construed as an admission that theembodiments described in this document are not entitled to antedate suchdisclosure by virtue of prior invention. As used herein, the term“comprising” means “including, but not limited to.”

The terms “memory,” “computer-readable medium” and “data store” eachrefer to a non-transitory device on which computer-readable data,programming instructions or both are stored. Unless the contextspecifically states that a single device is required or that multipledevices are required, the terms “memory,” “computer-readable medium” and“data store” include both the singular and plural embodiments, as wellas portions of such devices such as memory sectors.

Each of the terms “dilation,” “erosion,” “opening,” “closing,” or“morphological dilation,” “morphological erosion,” “morphologicalopening” and “morphological closing” refers to a corresponding term inmathematical morphological operations.

In FIG. 1, in some embodiments, a print system 100 may include aprocessing device 109 that is configured to accomplish variousconventional printing, scanning or other tasks as available in amulti-function peripheral (MFP). The print system may also include adocument handler 102 for automatically scanning one or more printdocuments 104 into electronic representations, e.g. electronic documentfiles. The print system may also include a port 103 that is configuredto receive a digital media storage device 105, e.g. a USB drive, andretrieve/write data from/to the digital media storage device. The printsystem may also include a communication port 111 that is configured tobe communicatively connected with one or more electronic devices or dataservers via a communication link, e.g. Wi-Fi, Bluetooth, Infrared orother known or later developed communication protocols, wired orwirelessly.

The print system 100 may be configured to generate one or more printeddocuments 106 from corresponding electronic documents, e.g. a PDF file,a Microsoft Word or a document file in other electronic forms. Thecontent of a page of a printed document ought to duplicate the contentof the electronic document to be printed. However, depending on theperformance of the print system, the printed document may not be aperfect mirror of the corresponding electronic document, and the printeddocument may have defects. Examples of printing defects include imagestreaking, image banding, excessive graininess, small area deletions andlarge area deletions, or other artifacts.

In some embodiments, the print system 100 may include an image sensor110, which can be configured to scan a page of a printed document intoan electronic document. The system may be configured to analyze theelectronic document in order to determine if the printed document hasany defects. In some embodiments, the image sensor may be a scan barinstalled on the print system and controlled by the processing device toscan a printed document before the printed document is placed on anoutput tray of the print system. In some embodiments, the image sensormay be installed separately from the print system, such as part of aseparate scanning device. The image sensor may be configured to scan theprinted document either automatically, or manually by prompting the userto scan the printed document for checking for defects. In someembodiments, an image system may have similar structures as embodimentsshown in FIG. 1. In some embodiments, instead of using a print engine toprint an electronic document or using an image sensor to scan a printeddocument, the image system may obtain a reference image representing theelectronic document from a storage device, a data store or a remoteservice via a communication port. Alternatively, and/or additionally,the image system may also obtain a target image representing a scannedelectronic document of a printed document that is printed and/or scannedelsewhere, for example, at a remote location or in a different system.Programming instructions for detecting defects can be executed by theprocessing device onboard the print system or image system, or executedby a remote device or a server on a cloud. The details of detectingdefects in a printed document are further described with reference toFIG. 2.

Various embodiments described in this document are applicable to bothprint systems and image systems. For example, in FIG. 2, according tosome embodiments, a system for detecting defects in a printed documentmay obtain a reference image 202 and obtain a target image 204. Thereference image includes the content of a page of an electronic documentto be printed. The target image includes the content of a page of anelectronic document that corresponds to the printed document, which hasbeen scanned into the electronic form by the image sensor. In someembodiments, the system looks for image variations (e.g. edges, thinlines, bands) in areas in the printed document where the correspondingarea in the original electronic document (or reference image) is smooth.Limiting the search for variation to just smooth areas of the referenceimage ensures insensitivity to mis-registration between reference andtarget images, which may be on the order of several pixels.

In some embodiments, in looking for image variations or smooth areas inthe reference image or target image, the system may determine anactivity matrix for the image, where the activity matrix includes theactivity levels for one or more pixels in the image. In someembodiments, the method calculates the activity matrix of an image byapplying a filter F(x,y) to the image as below:

A(x,y)=[{I(x,y)}² {circumflex over (×)}F(x,y)−{I(x,y} ² {circumflex over(×)}F(x,y)}²]^(0.5)   (1)

where the filter I(x,y) is the image, F(x,y) is the filter, and A(x,y)is the filtered image. In some embodiments, F(x,y) may satisfyΣ_(x)Σ_(y)F(x,y)=1 and F(x,y)>=0∀xy. Jensen's inequality ensures thatthe resulting calculation is positive, allowing a square root to betaken. In some embodiments, F(x,y) may be symmetric about both the x andy axis, i.e. F(−x,y)=F(x,y) and F(x,−y)=F(x,y). In some embodiments,F(x,y) also may be a separable filter in terms of x and y.

In some embodiments, the filter F(x,y) can be a standard deviation ofthe image at every pixel using a neighborhood around the pixel. Thestandard deviation pixel by pixel can be calculated using the variancecalculation represented by:

σ² =E{x ² }−E{x} ²

In some embodiments, the activity matrix can be calculated by using aRect filter, and the activity level of each pixel in image I(x,y) can beexpressed by:

σ(x,y)=[{I(x,y)}²{circumflex over (×)}Rect(x/x ₀ , y/y ₀)/(x ₀ ●y₀)−{I(x,y} ²{circumflex over (×)}Rect(x/x ₀ , y/y ₀)/(x ₀ −y ₀)}²]^(0.5)

where (x₀, y₀) represents the size of the window for the filter Rect.This reduces the calculation of standard deviation to a simple set of(operable) filtering operations and squaring operations. In someembodiments, the Rect filter is a low-pass filter. In some embodiments,the Rect filter may be a two-dimensional window that includes multiplecoefficients having equal values that are non-negative. In someembodiments, the sum of coefficients in the Rect filter may be 1.0.

In some embodiments, the filter F(x,y) can be other types of filters.For example, it can be a filter that can simultaneously “descreens” theimage (i.e. remove the halftone) as well as decreases the effect of anyscanner modulation transfer function (MTF).

Returning to FIG. 2, in some embodiments, the system may determine theactivity matrix for the reference image 206 and determine the activitymatrix for the target image 208. The system may use the same ordifferent filters for the reference image and the target image. Forexample, the Rect filter for both reference image and target image maybe of size 13×13 or 15×15, having all coefficients of equal values.

Returning to FIG. 2, the system may use the activity matrix of thereference image and that of the target image to classify one or moredefective pixels in the target image. In some embodiments, the systemmay classify a pixel in the target image defective when thecorresponding pixel in the reference image has no activity orcorresponds to a quiet area (i.e. the activity level value is below athreshold level of activity) while the pixel in the target image has asignificant activity. In some embodiments, the system may classify apixel as corresponding to a quiet area 211. The quiet area denotes anarea in which a pixel and its neighboring pixels exhibit less than athreshold level of activity. In a non-limiting example, the thresholdlevel of activity may depend on the scanner MTF. For example, if thegray scale of the image ranges between 0 and 255, the threshold level ofactivity may be 3.0. In other words, if the activity level of a pixel inthe image is below 3.0, the system may classify that pixel ascorresponding to a quiet area.

In some embodiments, the system may determine the difference betweenactivity level of each pixel in the target image and the activity levelof the corresponding pixel in the reference image 213. If the differenceexceeds a noise threshold 215, the system may classify the pixel in thetarget image as defective 218. The system may check for a subset ofpixels or all pixels in the target image that correspond to the quietarea in the reference 214 until all pixels have been processed 216. Insome embodiments, in determining the difference between the activitylevels in the target image and reference image exceeds a noisethreshold, the system may determine whether the activity level of thepixel in the target image is above a variation threshold of activitylevel, which may be a preset value or may depend on the scanner MTF. Forexample, if the gray scale of the image ranges between 0 and 255, thevariation threshold of activity level may be 3.0. In other words, if theactivity level of a pixel in the target image that corresponds to aquiet area in the reference image is above 3.0, then system may classifythat pixel in the target image as defective.

In some embodiments, in determining the difference between activitylevels in the target image and reference image exceeds a noisethreshold, the system may alternatively or additionally determinewhether the ratio of the activity level of each corresponding pixel inthe target image over the activity level of each pixel in the referenceimage is above a ratio threshold. If the ratio is above the ratiothreshold, the system may classify that pixel in the target image asdefective. In some embodiments, the ratio threshold may be apredetermined value, or may be dynamically determined depending on thescanner MTF. For example, if the gray scale of the image ranges between0 and 255, the ratio threshold of activity level may be 2.0. In otherwords, if the ratio of activity level of a pixel in the target imageover the activity level of the corresponding pixel in the referenceimage is above 2.0, the system may classify the target image pixel asdefective. In some embodiments, the system may select the thresholdlevel of activity, the variation threshold, and/or the ratio thresholddepending on the scanner MTF and the residual noise when descreening theprinted image with the filter (e.g. F(x,y)).

Optionally, in some embodiments, the system may reduce the sensitivityto misalignment between the reference image and the target image beforedetermining the difference between the activity levels of the two imagesin step 213. In some embodiments, the system may apply morphologicaloperations to both activity matrices for the reference image and thetarget image. For example, the system may perform a dilation on theactivity matrix of the reference image and update the activity matrix210 before classifying the pixels in the reference image. Thiseffectively finds the most active area of the reference image in acontext larger than the filter used to calculate the activity matrix. Insome embodiments, the system may perform a gray dilation on the activitymatrix of the reference image, in which the maximum value of every areagrows out into its neighbors defined by the structuring element of thedilation operation.

Alternatively, and/or additionally, the system may also perform grayerosion on the activity matrix of the target image 212 and update theactivity matrix of the target image before classifying the pixels in thetarget image. This erosion chooses the lowest activity area in a contextaround the current pixel. If the most active area of the image is verynear the current pixel (which is often true for a defect), then theerosion operation will provide a result similar to finding activity inan area that is the intersection of the neighborhoods used to calculatethe activity measure. It is therefore important that the structuringelement of erosion has a context less than the context size of thefilter, F(x,y), used to calculate the activity matrix. If not, there isno overlapping area (no pixel is used in all calculation) and the methodjust results in finding the quietest area which will never include asmall localized defect. Conversely, the structuring element must belarge enough to encompass the largest possible misalignment between thereference and target images. In some embodiments, the filter F(x,y) mayhave a 15×15 context size and an erosion structuring element may have a9×9 context size.

With further reference to FIG. 2, upon detecting the defective pixels inthe target image, the system may determine a defect detection map 220which includes all of the classified defective pixels in the targetimage. In some embodiments, the defect detection map may be a binaryimage, in which each value indicates whether or not each pixel isdefective. Additionally, in some embodiments, the system may connectclose defects 224 and/or remove small defects 226 in the defectdetection map.

In some embodiments, the system may connect one or more defective pixelsin the defect detection map into one or more connected components. Forexample, the system may apply a morphological closing operation(dilation followed by erosion) on the defect detection map, whichresults in an updated defect detection map, in which detected defectiveareas that are close to each other are connected. The morphologicalclosing involves a dilation followed by an erosion, and the structuringelements for the dilation and erosion may be the same or different. Forexample, in some embodiments, the dilation may use a structuring elementof a size 20, whereas the erosion may use a structure element of a size11×11 or 13×13. In some embodiments, the morphological closing may be abinary operation when the defect detection map is binary.

Alternatively, and/or additionally, the system may remove small defectsin the defect detection map 226. For example, the system may use amorphological opening (erosion followed by dilation) to remove smalldefects. The system may also use other methods, such as finding allconnected components in the defect detection map and removing theconnected components whose sizes are below a certain threshold.

Returning to FIG. 2, in some embodiments, the system may determine aconfidence level for the defect detection map 222. In a non-limitingexample, the system may analyze the post-closing defect detection map(from step 224) using a connected component analysis. The system maydetermine all or a subset of connected components in the defectdetection map, identify the size of each connected component, andidentify the largest single connected component. In some embodiments,the system may determine a bounding box for each connected component,and the size of the connected component may be measured in width and/orheight of the bounding box. Based on the largest dimension of all of thebounding boxes, the system may compute a confidence level of a defect(e.g. streak or band). In some embodiments, the confidence level mayincrease when the size of the largest connected component is above athreshold size.

In some embodiments, the system may report the result of defectdetection to the user. For example, the system may overlay the boundingboxes of connected components from the defect detection map on thescanned version of the printed document to indicate to the user thelocations of suspected defects. The system may display the overlaidresults on a display of the print system. The system may also transmitthe overlaid result indicating the locations of suspected defects to aremote electronic device of a user. The system may also print a hardcopydocument showing the locations of the suspected defects of the printout.The system may also display or report the confidence level to the defectdetection to the user. This reporting allows the user to be able todetermine whether the printed document is acceptable, and to determinewhether to reject the printed image or initiate printer maintenance.Alternatively, and/or additionally, the system may use the defectdetection results and the confidence level to make the recommendationautomatically. For example, if the number of connected components fromthe defect detection map exceeds a threshold and/or the confidence levelexceeds a confidence threshold, the system may determine to reject theprinted document or initiate printer maintenance. In another example, ifthe number of connected components from the defect detection map isbelow a threshold and/or the confidence level is below a confidencethreshold, the system may determine to accept the printed document.

The above illustrated embodiments essentially look for defects in areaswhere the reference image had little or no activity. Alternatively,and/or additionally, the system may look for activity in a particulardirection in the target image that does not exist in the referenceimage. For example, if the reference image has horizontal edges but novertical edges in a local context it is advantageous for the system tolook for vertical edges in the target image in that context rather thanignoring that area completely. In some embodiments, the system mayaccomplish this by filtering the image in one direction (e.g. just avertical filter N×1) and then calculating the standard deviation oractivity matrix using a filter in the perpendicular direction (e.g. ahorizontal filter 1×M). The system may determine both horizontal andvertical defects independently and merge the results. The details of theembodiments are further described with reference to FIG. 3.

In FIG. 3, in some embodiments, the system may obtain reference image302, and obtain target image 304 in a similar manner as that describedin embodiments in FIG. 2. The system may look for image variations orsmooth areas in the reference image or target image either horizontallyor vertically, and determine a horizontal activity matrix 306, 307 and avertical matrix 308, 309 for each of the reference image and the targetimage. The horizontal activity matrix includes the activity levels inhorizontal direction for one or more pixels in the image, and thevertical activity matrix includes the activity levels in verticaldirection. In some embodiments, the system may calculate the horizontalactivity matrix of an image by applying a filter F(x,y) to the image,where the filter runs in the horizontal direction only (e.g. a 1×Mfilter). Alternatively, and/or additionally, the system may calculatethe vertical activity matrix of an image by applying a filter F(x,y) tothe image, where the filter runs in the vertical direction only (e.g. aM×1 filter).

As similar to embodiments described in FIG. 2, the filter F(x,y) can bea standard deviation of the image at every pixel using a neighborhoodaround the pixel. The standard deviation pixel by pixel can becalculated using the variance calculation and/or a low-pass filter, suchas a Rect filter.

Returning to FIG. 3, in some embodiments, the system may determine thehorizontal activity matrix for the reference image 306 and determine thehorizontal activity matrix for the target image 308. Additionally, thesystem may independently determine the vertical activity matrix for thereference image 307 and determine the vertical activity matrix for thetarget image 309. The system may use the same or different filters forreference image and target image.

Returning to FIG. 3, the system may use the horizontal activity matrixof the reference image to classify one or more pixels in the referencethat corresponds to a quiet area (or no activity) 310. For the pixels inthe reference image that are classified as corresponding to a quietarea, the system may use horizontal activity levels of the correspondingpixels in the target image to determine defective pixels in the targetimage 318, in a similar manner as that in the embodiments described inFIG. 2. Similarly, the system may use the vertical activity matrix ofthe reference image to classify one or more pixels in the reference thatcorresponds to a quiet area (or no activity) 311. For the pixels in thereference image that are classified as corresponding to a quiet area,the system may use vertical activity levels of the corresponding pixelsin the target image to independently determine defective pixels in thetarget image 319.

In some embodiments, the system may determine a defect detection map 320by combining the defective pixels in the target image that areclassified as defective based on horizontal activity and those pixelsthat are classified as defective based on vertical activity. In someembodiments, the combination of defective pixels based on horizontal andvertical activities may be a union, i.e. the combined defect detectionmap includes all of the defective target image pixels that areclassified via either horizontal or vertical process.

Similar to steps 210, 212 described in embodiments in FIG. 2, the systemmay optionally perform morphological operations to the activity matricesof the reference and target images. For example, the system may performa dilation on the horizontal activity matrix and/or vertical activitymatrix of the reference image and update the activity matrices beforeclassifying the pixels in the reference image. In some embodiments, thesystem may perform a gray dilation on the activity matrix of thereference image. Alternatively, and/or additionally, the system may alsoperform gray erosion on the horizontal and/or vertical activity matrixof the target image and update the activity matrices of the target imagebefore classifying the pixels in the target image. Although the activitymatrix is either horizontal or vertical, the system may use aone-dimensional or two-dimensional structuring element to perform themorphological operations.

With further reference to FIG. 3, in similar embodiments as thosedescribed in FIG. 2, upon determining the defect detection map, thesystem may connect close defects 324 and/or remove small defects 326 inthe defect detection map. In some embodiments, the system may connectone or more defective pixels in the defect detection map into one ormore connected components. For example, the system may apply amorphological closing operation (dilation followed by erosion) on thedefect detection map, which results in an updated defect detection map,in which detected defective areas that are close to each other areconnected. The system may use a morphological opening (erosion followedby dilation) or other methods to remove small defects. In performing themorphological closing or opening, the dilation may use a structuringelement of a size 20×20, whereas the erosion may use a structuringelement of a size 11×11 or 13×13. In some embodiments, the morphologicalclosing may be a binary operation when the defect detection map isbinary. In similar embodiments as those described in FIG. 2, the systemmay also determine a confidence level for the defect detection map 322.The system may also display or report the defect detection result to theuser.

In some embodiments, the system may perform variations of theillustrated embodiments in FIGS. 2 and 3. In some embodiments, thesystem may switch the reference and target images—this results in thesystem effectively looking for areas that are quiet in the printed imagebut not the reference image. This may effectively detect the defects,such as large area deletions, where the printer fails to print thedesired image at all. As such, swapping the reference and target imagesmay detect defects due to deletions in the print system. Alternatively,and/or additionally, the system may perform the steps in each of FIG. 2and FIG. 3 with two passes, while swapping the reference image and thetarget image during the second pass, and combine the results from thetwo passes. This is further explained with reference to FIG. 4.

The system may be adapted from embodiments described in FIG. 2 such asprocess A. For example, in FIG. 4A, the system may perform the steps inprocess A (of FIG. 2) 410, swap the reference image and the target image412, and re-perform process A with the swapped reference and targetimages 413, where each pass of process A will classify defective targetimage pixels. The system then combines the results from the two passesof process A to determine defect detection map 414. In some embodiments,the defect detection map includes all of the classified defective pixelsin the target image from the two passes.

Alternatively, and/or additionally, the system may also be adapted fromembodiments described in FIG. 3 such as process B. In FIG. 4B, thesystem may perform the steps in process B (of FIG. 3) 450, swap thereference image and the target image 452, and re-perform process B withthe swapped reference and target images 453, where each pass of processB will classify defective target image pixels. The system then combinesthe results from the two passes of process A to determine defectdetection map. In some embodiments, the defect detection map may includeall of the classified defective pixels in the target image from the twopasses. It is to be noted that in the second pass of process A (in FIG.4A) or second pass of process B (in FIG. 4B), the classified defectivepixels in the target image are actually corresponding to defectivepixels in the original reference image, which will cover the scenariosin which deletions occur in a printed document.

The above illustrated embodiments described in FIGS. 1-4 can beimplemented in various configurations. For example, the system mayimplement these functions by a processing device of the print system, aprocessing device of an image system, a processing device of a remoteserver or a processing device on a cloud. FIG. 5 depicts an example ofinternal hardware that may be included in any of the electroniccomponents of the system, such as the processing device. An electricalbus 500 serves as an information highway interconnecting the otherillustrated components of the hardware. Processor 505 is a centralprocessing device of the system, configured to perform calculations andlogic operations required to execute programming instructions. As usedin this document and in the claims, the terms “processor” and“processing device” may refer to a single processor or any number ofprocessors in a set of processors, whether a central processing unit(CPU) or a graphics processing unit (GPU) or a combination of the two.Read only memory (ROM), random access memory (RAM), flash memory, harddrives and other devices capable of storing electronic data constituteexamples of memory devices 525. A memory device, also referred to as acomputer-readable medium, may include a single device or a collection ofdevices across which data and/or instructions are stored.

An optional display interface 530 may permit information from the bus500 to be displayed on a display device 535 in visual, graphic oralphanumeric format. An audio interface and audio output (such as aspeaker) also may be provided. Communication with external devices mayoccur using various communication devices 540 such as a transmitterand/or receiver, antenna, an RFID tag and/or short-range or near-fieldcommunication circuitry. A communication device 540 may be attached to acommunications network, such as the Internet, a local area network or acellular telephone data network.

The hardware may also include a user interface sensor 545 that allowsfor receipt of data from input devices 550 such as a keyboard, a mouse,a joystick, a touchscreen, a remote control, a pointing device, a videoinput device and/or an audio input device. Digital image frames also maybe received from an imaging capturing device 555 such as a scan barpositioned in a print system to capture a printed document while theelectronic document is being printed.

Optionally, the hardware may not need to include a memory, but insteadprogramming instructions are running on one or more virtual machines orone or more containers on a cloud. For example, the processing device102 (in FIG. 1) may be a server on a cloud that includes multiplevirtual machines, each virtual machine having an OS, a virtual disk,virtual network and Apps, and the programming instructions forimplementing various functions in the print system may be stored on oneor more of those virtual machines on the cloud.

The above-disclosed features and functions, as well as alternatives, maybe combined into many other different systems or applications. Variouspresently unforeseen or unanticipated alternatives, modifications,variations or improvements may be made by those skilled in the art, eachof which is also intended to be encompassed by the disclosedembodiments.

1. A system for detecting defects in a print system, comprising: a printengine configured to print a first electronic document to yield aprinted document; an image sensor configured to scan the printeddocument into a second electronic document; a processing device; and anon-transitory, computer-readable medium containing programminginstructions that are configured to cause the processing device to: (i)obtain a reference image comprising content of a page of the firstelectronic document, (ii) obtain a target image comprising content of apage of the second electronic document, (iii) analyze the referenceimage to determine a first activity matrix comprising activity levelsfor a plurality of pixels of the reference image, (iv) analyze thetarget image to determine a second activity matrix comprising activitylevels for a plurality of pixels in the target image, (v) use the firstactivity matrix to classify one or more pixels in the reference image ascorresponding to a quiet area, wherein the quiet area denotes an area inwhich a pixel and its neighboring pixels exhibit less than a thresholdlevel of activity, (vi) for at least a first subset of the pixels in thereference image that correspond to the quiet area, compare each pixel inthe first subset to a corresponding pixel in the target image todetermine whether a difference between the activity level of each pixelin the first subset and the activity level of the corresponding pixel inthe target image exceeds a noise threshold, and (vii) for any referenceimage pixel and corresponding target image pixel for which thedifference of activity level exceeds the noise threshold, classify thattarget image pixel as defective.
 2. The system of claim 1, furthercomprising additional programming instructions configured to cause theprocessing device to determine a defect detection map that compriseseach of the target image pixels that were classified as defective. 3.The system of claim 1, wherein: the programming instructions fordetermining the first activity matrix comprise programming instructionsconfigured to cause the processing device to calculate a standarddeviation for each of the pixels in the reference image using a firstlow-pass filter; and the programming instructions for determining thesecond activity matrix comprise programming instructions configured tocause the processing device to calculate a standard deviation for eachof the pixels in the target image using a second low-pass filter.
 4. Thesystem of claim 1, wherein: the programming instructions for classifyingthe one or more pixels in the reference image as corresponding to aquiet area comprise programming instructions configured to cause theprocessing device to determine that the activity levels of the one ormore pixels in the reference image are below a first threshold; and theprogramming instructions for determining that the difference of activitylevel exceeds the noise threshold comprise programming instructionsconfigured to cause the processing device to determine that: theactivity level of each corresponding pixel in the target image is abovea first threshold, and a ratio of the activity level of eachcorresponding pixel in the target image over the activity level of eachpixel of the first subset in the reference image is above a secondthreshold.
 5. The system of claim 1, further comprising additionalprogramming instructions configured to cause the processing device to:perform a morphological dilation on the first activity matrix to updatethe first activity matrix before classifying the pixels in the referenceimage; and perform a morphological erosion on the second activity matrixto update the second activity matrix before classifying the pixels inthe target image.
 6. The system of claim 2, further comprisingadditional programming instructions configured to cause the processingdevice to connect one or more defective pixels in the defect detectionmap into one or more connected components.
 7. The system of claim 6,further comprising additional programming instructions configured tocause the processing device to: identify from the one or more connectedcomponents in the defect detection map a largest connected component;and determine a confidence level to defect detection based on a size ofthe largest connected component.
 8. The system of claim 2, furthercomprising additional programming instructions configured to cause theprocessing device to: swap the content of the page in the referenceimage and the content of the page in the target image; repeat the steps(iii) to (vii); and update the defect detection map to additionallyinclude all of the target image pixels that were classified as defectivein repeating the steps (iii) to (vii).
 9. The system of claim 1,wherein: the first activity matrix is a horizontal activity matrixcomprising horizontal activity levels for the plurality of pixels of thereference image; the second activity matrix is a horizontal activitymatrix comprising horizontal activity levels for the plurality of pixelsin the target image; the programming instructions are also configured tocause the processing device to: (viii) analyze the reference image todetermine a first vertical activity matrix comprising vertical activitylevels for a plurality of pixels of the reference image, (ix) analyzethe target image to determine a second vertical activity matrixcomprising vertical activity levels for a plurality of pixels in thetarget image, (x) use the first vertical activity matrix to classify oneor more pixels in the reference image, based on their activity levels,as corresponding to a variation area, (xi) for at least a second subsetof pixels in the reference image that correspond to the variation area,compare each pixel in the second subset to a corresponding pixel in thetarget image to determine whether a difference between the verticalactivity level of each pixel in the second subset and the verticalactivity level of the corresponding pixel in the target image exceeds anoise threshold, (xii) for any reference image pixel and correspondingtarget image pixel, for which the difference of vertical activity levelexceeds the noise threshold, classify that target image pixel asdefective, and (xiii) determine a defect detection map that comprisesall of the target image pixels that were classified as defective insteps (vii) and (xii).
 10. The system of claim 9, further comprisingadditional programming instructions configured to cause the processingdevice to connect one or more defective pixels in the defect detectionmap into one or more connected components.
 11. The system of claim 10,further comprising additional programming instructions configured tocause the processing device to: identify from the one or more connectedcomponents in the defect detection map a largest connected component;and determine a confidence level to defect detection based on a size ofthe largest connected component.
 12. The system of claim 9, furthercomprising additional programming instructions configured to cause theprocessing device to: swap the content of the page in the referenceimage and the content of the page in the target image; repeat the steps(iii) to (xii); and update the defect detection map to additionallyinclude all of the target image pixels that were classified as defectivein repeating the steps (iii) to (xii).
 13. A method of detecting defectsin a print system, comprising: (i) obtaining, by a processing device, areference image comprising content of a page of a first electronicdocument; (ii) scanning, by the processing device, a printed document ofthe first electronic document into a target image; (iii) analyzing, bythe processing device, the reference image to determine a first activitymatrix comprising activity levels for a plurality of pixels of thereference image; (iv) analyzing, by the processing device, the targetimage to determine a second activity matrix comprising activity levelsfor a plurality of pixels in the target image; (v) using, by theprocessing device, the first activity matrix to classify one or morepixels in the reference image as corresponding to a quiet area, whereinthe quiet area denotes an area in which a pixel and its neighboringpixels exhibit less than a threshold level of activity; (vi) for atleast a first subset of the pixels in the reference image thatcorrespond to the quiet area, comparing, by the processing device, eachpixel in the first subset to a corresponding pixel in the target imageto determine whether a difference between the activity level of eachpixel in the first subset and the activity level of the correspondingpixel in the target image exceeds a noise threshold; and (vii) for anyreference image pixel and corresponding target image pixel, for whichthe difference of activity level exceeds the noise threshold,classifying that target image pixel as defective.
 14. The method ofclaim 13, further comprising determining a defect detection map thatcomprises each of the target image pixels that were classified asdefective.
 15. The method of claim 13, wherein: determining the firstactivity matrix comprises calculating a standard deviation for each ofthe pixels in the reference image using a first low-pass filter; anddetermining the second activity matrix comprises calculating a standarddeviation for each of the pixels in the target image using a secondlow-pass filter.
 16. The method of claim 13, wherein the first low-passand the second low-pass filters are a two-dimensional window comprisinga plurality of coefficients having equal values.
 17. The method of claim13, wherein classifying the one or more pixels in the reference image ascorresponding to a quiet area comprises determining that the activitylevels of the one or more pixels in the reference image are below afirst threshold; and determining that the difference of activity levelexceeds the noise threshold comprises determining that: the activitylevel of each corresponding pixel in the target image is above a firstthreshold, and a ratio of the activity level of each corresponding pixelin the target image over the activity level of each pixel of the subsetin the reference image is above a second threshold.
 18. The method ofclaim 13, further comprising: performing, by the processing device, amorphological dilation on the first activity matrix to update the firstactivity matrix before classifying the pixels in the reference image;and performing, by the processing device, a morphological erosion on thesecond activity matrix to update the second activity matrix beforeclassifying the pixels in the target image.
 19. The method of claim 18,wherein the morphological dilation is a gray-scale dilation and themorphological erosion is a gray-scale erosion.
 20. The method of claim14, further comprising connecting one or more defective pixels in thedefect detection map into one or more connected components.
 21. Themethod of claim 20, wherein connecting the one or more defective pixelsin the defect detection map comprises performing a morphological closingon the defect detection map.
 22. The method of claim 20, furthercomprising performing, by the processing device, a morphological openingon the defect detection map.
 23. The method of claim 20, furthercomprising, by the processing device: identifying from the one or moreconnected components in the defect detection map a largest connectedcomponent; and determining a confidence level to defect detection basedon a size of the largest connected component.
 24. The method of claim14, further comprising, by the processing device: swapping the contentof the page in the reference image and the content of the page in thetarget image; repeating the steps (iii) to (vii); and updating thedefect detection map to additionally include all of the target imagepixels that were classified as defective in repeating the steps (iii) to(vii).
 25. The method of claim 13, wherein the first activity matrix isa horizontal activity matrix that includes horizontal activity levelsfor the plurality of pixels of the reference image and the secondactivity matrix is a horizontal activity matrix that includes horizontalactivity levels for the plurality of pixels of the target image, themethod further comprising: (viii) analyzing, by the processing device,the reference image to determine a first vertical activity matrixcomprising vertical activity levels for a plurality of pixels of thereference image; (ix) analyzing, by the processing device, the targetimage to determine a second vertical activity matrix comprising verticalactivity levels for a plurality of pixels in the target image; (x)using, by the processing device, the first vertical activity matrix toclassify one or more pixels in the reference image, based on theiractivity levels, as corresponding to a variation area; (xi) for at leasta second subset of pixels in the reference image that correspond to thevariation area, comparing, by the processing device, each pixel in thesecond subset of the pixels to a corresponding pixel in the target imageto determine whether a difference between the vertical activity level ofeach pixel in the second subset and the vertical activity level of thecorresponding pixel in the target image exceeds a noise threshold; (xii)for any reference image pixel and corresponding target image pixel forwhich the difference of vertical activity level exceeds the noisethreshold, classifying that target image pixel as defective; and (xiii)determining, by the processing device, a defect detection map thatcomprises all of the target image pixels that were classified asdefective in the steps (vii) and (xii).
 26. The method of claim 25,further comprising connecting one or more defective pixels in the defectdetection map into one or more connected components.
 27. The method ofclaim 26, further comprising: identifying, by the processing device,from the one or more connected components in the defect detection map alargest connected component; and determining, by the processing device,a confidence level to defect detection based on a size of the largestconnected component.
 28. The method of claim 25, further comprising:swapping, by the processing device, the content of the page in thereference image and the content of the page in the target image;repeating, by the processing device, the steps (iii) to (xii); andupdating, by the processing device, the defect detection map toadditionally include all of the target image pixels that were classifiedas defective in repeating the steps (iii) to (xii).